home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #5 / Amiga Plus CD - 2000 - No. 5.iso / Tools / Dev / fpc / source / docs / stringex / ex8.pp < prev    next >
Encoding:
Text File  |  2000-01-01  |  418 b   |  21 lines

  1. Program Example8;
  2.  
  3. Uses strings;
  4.  
  5. { Program to demonstrate the StrLComp function. }
  6.  
  7. Const P1 : PChar = 'This is the first string.';
  8.       P2 : PCHar = 'This is the second string.';
  9.  
  10. Var L : Longint; 
  11.  
  12. begin
  13.   Write ('P1 and P2 are ');
  14.   If StrComp (P1,P2)<>0 then write ('NOT ');
  15.   write ('equal. The first ');
  16.   L:=1;
  17.   While StrLComp(P1,P2,L)=0 do inc (L);
  18.   dec(l);
  19.   Writeln (l,' characters are the same.');
  20. end.
  21.